package cn.tony.game.super_tank;

import java.awt.Image;
import java.awt.Toolkit;

public class MediaUtils {

	private static final Image tank_r = MediaUtils.createImage("tank-right.png");
	private static final Image tank_u = MediaUtils.createImage("tank-up.png");
	private static final Image tank_l = MediaUtils.createImage("tank-left.png");
	private static final Image tank_d = MediaUtils.createImage("tank-down.png");
	private static final Image tank_ur = MediaUtils.createImage("tank-north-east.png");
	private static final Image tank_ul = MediaUtils.createImage("tank-north-west.png");
	private static final Image tank_dr = MediaUtils.createImage("tank-south-east.png");
	private static final Image tank_dl = MediaUtils.createImage("tank-south-west.png");
	
	public static final Image boom = createImage("boom.png");
	public static final Image bg = createImage("bg.jpg");

	
	
	public static final ImageDirectional TankImageDir = new ImageDirectional(
			new Image[] { tank_l, tank_ul, tank_u, tank_ur, tank_r, tank_dr, tank_d, tank_dl });

	
	public static Image createImage(String name) {
		name = "img/" + name;
		return Toolkit.getDefaultToolkit().getImage(Tank.class.getClassLoader().getResource(name));
	}

}
